package model

import "gorm.io/gorm"

type CategoryBasic struct {
	gorm.Model
	Identity string          `gorm:"column:identity;type:varchar(36);index" json:"identity"`
	Problems []*ProblemBasic `gorm:"many2many:problem_category;foreignKey:Identity;references:Identity;joinForeignKey:CategoryId;joinReferences:ProblemId"`
	Name     string          `gorm:"column:name;type:varchar(100)" json:"name"`
	ParentId uint            `gorm:"column:parent_id;type:int(11)" json:"parent_id"`
}

func (table *CategoryBasic) TableName() string {
	return "category_basic"
}
